package grm.info;

import java.util.ArrayList;

public class Double11Good implements IGood{
    int originalPrice;
    double discount;
    String name;

    public Double11Good(ArrayList<String> arrayList) {
        originalPrice  = Integer.parseInt(arrayList.get(0));
        discount  = Double.parseDouble(arrayList.get(1));
        name = arrayList.get(2);
    }

    public Double11Good(int price, double disc, String name) {
        this.originalPrice = price;
        this.discount = disc;
        this.name = name;
    }
    @Override
    public int getPrice() {
        return (int) (originalPrice*discount);
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public String toString() {
        return "Double11Good{" +
                "originalPrice=" + originalPrice +
                ", discount=" + discount +
                ", name='" + name + '\'' +
                '}';
    }
}
